<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>

<h1>User Profile</h1>

<c:url var="usersUrl" value="/users/profile"/>
<form:form modelAttribute="user" action="${usersUrl}" method="post" cssClass="inline">
    <span class="errors span-18">
    	<form:errors path="*"/>
    	<spring:hasBindErrors name="user">
			<div class="error">
				<spring:bind path="user.*">
					<c:forEach items="${status.errorMessages}" var="error">
						<span><c:out value="${error}"/></span><br>
					</c:forEach>
				</spring:bind>
			</div>
		</spring:hasBindErrors>
    </span>
    <form:hidden id="version" path="version"/><br/>
    <fieldset>
		<div class="span-8">			
			<label for="state">user name:</label>
			${user.username}<br/>
			
			<label for="nickname">nickname:</label>
			<form:input id="nickname" path="nickname"/><br/>
			
			<label for="name">password:</label>
			<form:password id="password" path="password"/><br/>
			 
			
		</div>
		<div class="span-3 last">
			<button type="submit">OK</button>
		</div>		
    </fieldset>
</form:form>

